package cnam.smb215.findfriends;

import java.util.Date;

public class Person implements Comparable<Person> {
	private int id;
	private String name, email;
	private int latitude, longitude;
	private Date lastSeen;

	public Person(int id, String name, String email, int latitude, int longitude, Date lastSeen) {
		this.id = id;
		this.name = name;
		this.email = email;
		this.latitude = latitude;
		this.longitude = longitude;
		this.lastSeen = lastSeen;
	}

	public Person(int id, String name, String email)
	{
		this(id, name, email, 0, 0, null);
	}

	public void updateLocation(int latitude, int longitude) {
		setLatitude(latitude);
		setLongitude(longitude);
		setLastSeen(new Date());
	}

	public int getID() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getLatitude() {
		return latitude;
	}

	public void setLatitude(int latitude) {
		this.latitude = latitude;
	}

	public int getLongitude() {
		return longitude;
	}

	public void setLongitude(int longitude) {
		this.longitude = longitude;
	}

	public Date getLastSeen() {
		return lastSeen;
	}

	public void setLastSeen(Date lastSeen) {
		this.lastSeen = lastSeen;
	}

	public int compareTo(Person another) {
		return this.name.compareToIgnoreCase(another.getName());
	}
}